
<?php
/**
 Template Name:get_game
 * @package WordPress
 * @subpackage Default_Theme
 * @author: shiwei
 */
	//here you can add other condition
	$keyword = urldecode($_REQUEST['keyword']);
	$queryStr ="select post_title from wp_posts where post_type='post' and post_status='publish' ";
	if($keyword != null && $keyword !==''){
		$queryStr .=" and post_title like '%".$keyword."%'";
	}
	$queryStr .=" limit 0,10 ";
	
	$posts = $wpdb->get_results($queryStr );
	foreach($posts as $v){
		echo $v->post_title."|".$v->post_title."\n";
	}
	
	/*$wp_query->set("post_title",$keyword );
	query_posts('orderby=post_date&showposts=10');
	while (have_posts()) : the_post(); 
		the_title() ;
		echo "|" ;
		the_title() ;
		echo "\n" ;
	endwhile;*/

	die();
	
?>
